package com.easyaccount.dao;

import com.easyaccount.bean.LoginUser;
import com.easyaccount.bean.UserVO;
import com.easyaccount.model.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    User selectByPhone(String phone);

    User selectByEmail(String email);

    User selectByPhoneOrEmail(LoginUser user);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    List<UserVO> selectPage(@Param("start") int start, @Param("size") int size, @Param("searchValue") String searchValue);

    int selectPageCount(@Param("start") int start, @Param("size") int size, @Param("searchValue") String searchValue);

    int selectByIdAndEmailCount(User user);

    int selectByIdAndPhoneCount(User user);
}